<template>
	<div id="dept">
	<button @click="adddept">添加部门</button>
		<button @click="modept">修改POST部门</button>
	</div>
</template>

<script>
	export default {
		name: 'Dept',
		data() {
			return {
				dept: {
					deptno: 33,
					dname: 'TTC',
					loc: '沈阳市'
				}
			}
		},
		methods: {
			modept(){
				const path = '/dept/mod';
				this.$axios.post(path, this.dept)
				.then( response =>{
					console.log(response);
				})
				.catch(error=>{
					console.log(error);
				});
			},
			adddept() {
				const path = '/dept/add';
				this.$axios.put(path, this.dept)
				.then( response =>{
					console.log(response);
				})
				.catch(error=>{
					console.log(error);
				});
			}
		},
	}
</script>

<style lang="less" scoped>
</style>
